﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Nes4Net
{
    public class Controller
    {
        public const Int32 BUTTON_A = 0;
        public const Int32 BUTTON_B = 1;
        public const Int32 BUTTON_SELECT = 2;
        public const Int32 BUTTON_START = 3;
        public const Int32 BUTTON_UP = 4;
        public const Int32 BUTTON_DOWN = 5;
        public const Int32 BUTTON_LEFT = 6;
        public const Int32 BUTTON_RIGHT = 7;


        public Int32[] state { get; private set; }
        public Controller() 
        {
            this.state = new Int32[8];
            Array.Fill(this.state, 0x40);
        }

        public void ButtonDown(Int32 key) 
        {
            this.state[key] = 0x41;
        }

        public void ButtonUp(Int32 key)
        {
            this.state[key] = 0x40;
        }
    }
}
